<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>GeoWave</title>
    <link rel="stylesheet" type="text/css" href="stylesheets/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="stylesheets/bootstrap-theme.min.css">
    <link rel="stylesheet" type="text/css" href="stylesheets/carousel.css">
    <link rel="stylesheet" href="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css">
    <style type='text/css'>.container-fluid { margin-top: 30px; }</style>
</head>
<body>

    <!-- Start Navbar -->
    <div class="navbar-wrapper">
        <div class="container">
            <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="index.html">GeoWave</a>
                    </div>
                    <div id="navbar" class="navbar-collapse collapse">
                        <ul class="nav navbar-nav">
                            <li><a href="userguide.html#installation-from-rpm">Documentation</a></li>
                            <li class="active"><a href="#packages" role="tab" data-toggle="tab">Packages</a></li>
                            <li><a href="#release" role="tab" data-toggle="tab">Release RPMs</a></li>
                            <li><a href="#dev" role="tab" data-toggle="tab">Development RPMs</a></li>
							<li><a href="#release-jars" role="tab" data-toggle="tab">Release JARs</a></li>
                            <li><a href="#dev-jars" role="tab" data-toggle="tab">Development JARs</a></li>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
    </div>
    <!-- End Navbar -->

    <!-- Start Main Content Container -->
    <div class="container-fluid">
        <div class="row">
            <div class="col-xs-6 col-md-1">&nbsp;</div>
            <div class="col-xs-6 col-md-10">

                <!-- Start Tabs -->
                <div role="tabpanel">
                    <div class="tab-content" data-toggle="tab">
                        <div role="tabpanel" class="tab-pane active" id="packages">
                            <div class="page-header col-md-12">
                                <h2> GeoWave Packages</h2>
                                <p>
                                    This site contains links to GeoWave jar files, RPM packaged versions of GeoWave and compressed 
									archives (which include other content like service and logrotate scripts in addition to the source code). 
									Individual files can be download or you can configure a host to install and keep updated with YUM 
									using the commands below.
                                </p>
                                <br/>
                                <h4>Configure a host to use GeoWave Release RPMs</h4>
                        <pre>
						
		rpm -Uvh http://s3.amazonaws.com/geowave-rpms/release/noarch/geowave-repo-1.0-3.noarch.rpm
		yum --enablerepo=geowave search geowave-$VERSION-$VENDOR (example: geowave-0.9.4-apache)
                        </pre>
                                <br/>
								<h4>Configure a host to use GeoWave Development RPMs</h4>
                        <pre>
						
		rpm -Uvh http://s3.amazonaws.com/geowave-rpms/dev/noarch/geowave-repo-dev-1.0-3.noarch.rpm
		yum --enablerepo=geowave-dev search geowave-$VERSION-$VENDOR (example: geowave-0.9.5-apache)
                        </pre>
                                <br/>
                                <p>
								<div class="row">
									<div class="col-lg-6">
										<h4>Packages/RPMs Available</h4>
										<ul class="package-listing">
											<li>
												<b>geowave-*-accumulo</b><br/>
												This package installs the Accumulo components of GeoWave
											</li>
											<li>
												<b>geowave-*-hbase</b><br/>
												This package installs the HBase components of GeoWave
											</li>
											<li>
												<b>geowave-*-core</b><br/>
												This package installs the GeoWave home directory and user account
											</li>
											<li>
												<b>geowave-*-docs</b><br/>
												This package installs the GeoWave documentation
											</li>
											<li>
												<b>geowave-*-tools</b><br/>
												This package installs the GeoWave command line tools (ingest, stats etc.)
											</li>
											<li>
												<b>geowave-*-jetty</b><br/>
												This package installs the web application server
											</li>
											<li>
												<b>geowave-*-puppet</b><br/>
												This package installs the GeoWave Puppet module into /etc/puppet/modules on a Puppet Server
											</li>
											<li>
												<b>geowave-*-single-host</b><br/>
												This package installs all the components on a single host and will likely be useful for dev environments
											</li>
											<li>
												<b>geowave-*.src.rpm</b><br/>
												The source RPM file that contains definitions for all the component RPMs listed above
											</li>
											<li>
												<b>geowave-$TIME_TAG.tar.gz</b><br/>
												All of the prebuilt component jars and other artifacts that are common to all vendors packaged into a compressed archive instead of an RPM format
											</li>
											<li>
												<b>geowave-$TIME_TAG-$VENDOR.tar.gz</b><br/>
												All of the prebuilt component jars and other artifacts that are vendor-specific packaged into a compressed archive instead of an RPM format
											</li>
											<li>
												<b>geowave-repo</b><br/>
												This package will install the GeoWave RPM repo config file into /etc/yum.repos.d
											</li>
											<li>
												<b>geowave-repo-dev</b><br/>
												This package will install the GeoWave Development RPM repo config file into /etc/yum.repos.d
											</li>
										</ul>
									</div>
									<div class="col-lg-6">
										<h4>JARs Available</h4>
										<ul class="jar-listing">
											<li>
												<b>geowave-*-tools.jar</b><br/>
												Tools jar used for GeoWave CLI commands
											</li>
											<li>
												<b>geowave-*-accumulo-singlejar.jar</b><br/>
												Accumulo datastore jar to be placed in HDFS
											</li>
											<li>
												<b>geowave-*-hbase-singlejar.jar</b><br/>
												HBase datastore jar to be placed in HDFS
											</li>
											<li>
												<b>geowave-*-geoserver-singlejar.jar</b><br/>
												GeoServer jar, added to the geoserver WEB-INF/lib to add GeoWave as a GeoServer plugin
											</li>
										</ul>
									</div>
								</div>
                                </p>
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="release">
                            <div class="page-header col-md-12">
                                <h3>Release Packages/RPMs</h3>
                                <p class="refresh"><a href="#" class="btn btn-xs btn-default" role="button">
                                    <span class="glyphicon glyphicon-refresh"></span> Refresh</a>
                                </p>
                                <p>
                                    These are stable releases and are the recommended option to use for your deployment. There
                                    are RPMs, SRPMs and .tar.gz archives included in the list, use the search to filter.
                                </p>
                                <div class="table-responsive">
                                    <table class="file-listing display compact" cellspacing="0" width="100%">
                                        <thead><tr><th>Name</th><th>Last Modified</th><th>Size</th></tr></thead>
                                    </table>
                                </div>
                                <div class="timestamp"></div>
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="dev">
                            <div class="page-header col-md-12">
                                <h3>Development Packages/RPMs</h3>
                                <p class="refresh"><a href="#" class="btn btn-xs btn-default" role="button">
                                    <span class="glyphicon glyphicon-refresh"></span> Refresh</a>
                                </p>
                                <p>
                                    These are built for every commit that passes automated tests. There
                                    are RPMs, SRPMs and .tar.gz archives included in the list, use the search to filter.
                                </p>
                                <div class="table-responsive">
                                    <table class="file-listing display compact" cellspacing="0" width="100%">
                                        <thead><tr><th>Name</th><th>Last Modified</th><th>Size</th></tr></thead>
                                    </table>
                                </div>
                                <div class="timestamp"></div>
                            </div>
                        </div>
						<div role="tabpanel" class="tab-pane" id="release-jars">
                            <div class="page-header col-md-12">
                                <h3>Release JARs</h3>
                                <p class="refresh"><a href="#" class="btn btn-xs btn-default" role="button">
                                    <span class="glyphicon glyphicon-refresh"></span> Refresh</a>
                                </p>
                                <p>
                                    These are stable releases and are the recommended option to use for your deployment.
                                </p>
                                <div class="table-responsive">
                                    <table class="file-listing display compact" cellspacing="0" width="100%">
                                        <thead><tr><th>Name</th><th>Last Modified</th><th>Size</th></tr></thead>
                                    </table>
                                </div>
                                <div class="timestamp"></div>
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="dev-jars">
                            <div class="page-header col-md-12">
                                <h3>Development JARs</h3>
                                <p class="refresh"><a href="#" class="btn btn-xs btn-default" role="button">
                                    <span class="glyphicon glyphicon-refresh"></span> Refresh</a>
                                </p>
                                <p>
                                    These are built for every commit that passes automated tests.
                                </p>
                                <div class="table-responsive">
                                    <table class="file-listing display compact" cellspacing="0" width="100%">
                                        <thead><tr><th>Name</th><th>Last Modified</th><th>Size</th></tr></thead>
                                    </table>
                                </div>
                                <div class="timestamp"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- End Tabs -->

            </div>
            <div class="col-xs-6 col-md-1">&nbsp;</div>
        </div>
    </div>
    <!-- End Content Container -->

<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js"></script>
<script>
    // Pasted here just so we only have a single file to deploy
    var S3List = (function () {

        /* 2014 Jason Mulligan - license BSD-3 - http://filesizejs.com - 2.0.4 */
        (function(p){function g(g,c){var b="",d=0,a,h,m,f,n,e,k,l;if(isNaN(g))throw Error("Invalid arguments");c=c||{};h=!0===c.bits;e=!0===c.unix;d=void 0!==c.base?c.base:e?2:10;n=void 0!==c.round?c.round:e?1:2;k=void 0!==c.spacer?c.spacer:e?"":" ";l=void 0!==c.suffixes?c.suffixes:{};f=Number(g);m=0>f;b=2<d?1E3:1024;m&&(f=-f);0===f?e?b="0":(a="B",b="0"+k+(l[a]||a)):(a=Math.floor(Math.log(f)/Math.log(1E3)),8<a&&(a=8),d=2===d?f/Math.pow(2,10*a):f/Math.pow(1E3,a),h&&(d*=8,d>b&&(d/=b,a++)),b=d.toFixed(0<a?n:
                0),a=q[h?"bits":"bytes"][a],e?(h&&r.test(a)&&(a=a.toLowerCase()),a=a.charAt(0),e=b.replace(s,""),"B"===a?a="":h||"k"!==a||(a="K"),t.test(e)&&(b=parseInt(b,u).toString()),b+=k+(l[a]||a)):e||(b+=k+(l[a]||a)));m&&(b="-"+b);return b}var r=/b$/,u=10,s=/.*\./,t=/^0$/,q={bits:"B kb Mb Gb Tb Pb Eb Zb Yb".split(" "),bytes:"B kB MB GB TB PB EB ZB YB".split(" ")};"undefined"!==typeof exports?module.exports=g:"function"===typeof define?define(function(){return g}):p.filesize=g})(this);
        // End filesize.js

        function baseName(str) { return str.substring(str.lastIndexOf('/') + 1); }

        function startsWith(item, prefix) { return (item.substring(0, prefix.length) === prefix); }

        function isInSkipList(item, list) {
            for(var i=0; i<list.length; i++) { if (item.indexOf(list[i]) > -1) return true; }
            return false;
        }

        return function (opts) {
            var _url = '';
            var _skipList = [];
            var _cache = { content: {}, timestamp: 0 };
            var _cacheTimeout;
            var _table = null;

            this.load = function() { this.load(false); };
            this.load = function(noCache) {
                if(noCache || new Date().getTime() - _cache.timestamp > _cacheTimeout) {
                    $.ajax({
                        url: _url, type: "GET", dataType: "xml", async: false, success: this.loadCache
                    });
                }
            };

            this.loadCache = function(data) {
                _cache.content = data;
                _cache.timestamp = new Date().getTime();
            };

            this.refresh = function(eventHash) { this.refresh(eventHash, false); };
            this.refresh = function(eventHash, nocache) {
                this.load(nocache);
                var buffer = [];
                $(_cache.content).find("Contents").each(function () {
                    var fileName = $(this).find('Key').text();
                    var fileSize = $(this).find('Size').text();
                    if (fileSize !== '0' && !isInSkipList(fileName, _skipList)) {
                        if(startsWith(fileName, eventHash.substring(1) + '/')) {
                            buffer.push([
                                '<a href="' + _url + fileName + '" download="' + baseName(fileName)  + '" target="_blank">' + baseName(fileName) + '</a>',
                                $(this).find('LastModified').text(),
                                filesize($(this).find('Size').text())
                            ]);
                        }
                    }
                });

                if(_table !== null) _table.api().destroy(); // Can't reload, have to recreate each time
                _table = $('.file-listing').dataTable({
                    "destroy": true,
                    "lengthMenu": [[-1, 10, 25, 50], ["All", 10, 25, 50]],
                    "order": [[1, "desc"]],
                    "columnDefs": [
                        {"targets": 0, "width": "50%"},
                        {"targets": 2, "orderable": false}
                    ],
                    "data": buffer
                });
                $('.timestamp').html("Last Updated: " + new Date(_cache.timestamp).toISOString());
            };

            _url = opts.url || '';
            _skipList = opts.list || [];
            _cacheTimeout = opts.cache || 300000;
        };
    })();

    $(function () {
        var currentTab, REFRESH_INTERVAL = 900000;

        var list = new S3List({
            url: '//s3.amazonaws.com/geowave-rpms/',
            list: ['repodata', '.html'],
            cache: REFRESH_INTERVAL - 1
        });

        $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
            currentTab = e.target.hash;
            list.refresh(currentTab); // #dev or #release etc.
        });
        $('.refresh').on('click', function() { list.refresh(currentTab, true); });
        setInterval(function () { list.refresh(currentTab); }, REFRESH_INTERVAL);
    });
</script>
</body>
</html>
